---
title: Fixed Variables
sidebar_label: "value"
---

import FragmentVarsName from '../../fragments/vars-name.mdx';

You can specify fixed variables with the `value` field. This cannot be used together with `default` in a single variable definition.
```yaml {3,5-8}
images:
  database:
    image: "mysql:${MYSQL_VERSION}"
vars:
- name: MYSQL_VERSION
  value: "5.5"
- name: NAMESPACE
  value: ${devspace.namespace}-suffix
# If you set 'default: my-value' and 'source: none' will be 
# internally converted to 'value: my-value'.
# Both variable definitions below are handled exactly the same
- name: SOURCE_NONE
  default: my-value
  source: none
- name: SOURCE_NONE
  value: my-value
```

:::note OVERWRITING
If you want to overwrite a fixed variable, you can use the `--var FIXED=new-value` flag
::: 

## Configuration

### `name`

<FragmentVarsName/>

### `value`

The `value` option expects a string, integer or boolean defining the value for the variable. You can also use other variables in a value, with one of the following conditions being true:

- The used variable is defined before the variable that wants to use it
- The used variable is a predefined variable

### `alwaysResolve`

If enabled, the variable will be loaded even though it is not used within the config. This might be useful for variables that should be resolved after a config expression is applied. E.g.:

`devspace.yaml`:
```
vars:
- name: my-var
  value: my-value
  alwaysResolve: true
hooks:
- name: my-hook
  command: $(cat command.txt)
  events: ["after:deploy"]
```

`command.txt`:
```
echo Hello ${my-var}!
```
